<?php

namespace app\middleware;

use app\model\Common;
use Closure;
use think\facade\View;

/**
 * 商城信息
 * User : Du
 * Date : 2022/11/27
 * Time : 17:31
 * Class ShopCheck
 * @package projects\middleware
 */
class Shop
{
    public function handle($request, Closure $next)
    {

        $userData = session('shop_user_data');
        if (!$userData) {
            $userData = [];
        }
        $shopData = Common::getData(WebsiteTable, ['id' => 2], ['name', 'icon', 'desc', 'copyright', 'domain']);
        View::assign('userData', $userData);
        View::assign('shopData', $shopData);
        return $next($request);
    }
}